package com.study.scheduled.controller;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * @description: 静态定时任务
 * @author: Leo
 * @createDate: 2020/4/19
 * @version: 1.0
 */
//@Configuration
@RestController
@EnableScheduling
public class ScheduleTask
{
    @Scheduled(fixedDelay = 5000)
    @GetMapping("/cc")
    private void configureTasks() {
        System.err.println("执行静态定时任务时间: " + LocalDateTime.now());
    }
}
